|
|
|
|
|
|
|
Use the information in Table 6.7 to set the properties of the command button. |
|
|
|
|
| Table 6.7. Property settings for the Print command button. | | Control | Properties | Settings | | Command Button | Name | cmdPrint | | Caption | &Print | | Font | Ms Sans Serif | | | Regular, 8 point | | Height | 330 | | Left | 7440 | | Top | 4080 | | Width | 1200 |
|
|
|
|
|
|
Now add the following line of code behind the cmdPrint_Click event (this code line starts Crystal Reports Pro): |
|
|
|
|
|
|
|
|
Private Sub cmdPrint_Click()
CrystalReport1.Action = 1 'force Crystal Reports Pro to run report
End Sub |
|
|
|
|
|
|
|
|
Now save and run the program. When you click the Print button, Crystal Reports Pro creates the report and sends it to a screen window. You can preview this report in the window and, if you like, use the Print button on the report window toolbar to send the report to the printer. (See Figure 6.22.) |
|
|
|
|
|
|
|
|
Figure 6.22.
Viewing the report from Visual Basic 5. |
|
|
|
|
|